

<script>
	import { deleteLiveStreamVideoTimeCache } from "/request.js";
	import { updateADSDataByGroupID } from "/global.js";
	
	export default {
		props: {
			groupId: Number,
			id: Number,
			comment: String,
			startTime: String,
			endTime: String,
			videoURL: String,
			required: true
		},
		methods: {
			async clickDelete()
			{
				console.log("clickDelete");
				console.log("删除 任务" + this.id);
				await deleteLiveStreamVideoTimeCache(this.id);
				updateADSDataByGroupID(this.groupId);
			}
		}
	}
	
</script>

<template>
	
	<li class="list-item">
		<view class="list-item-info">
			<label class="list-item-comment">{{comment}}</label>
			<label>任务开始时间：{{startTime}}</label>
			<label>任务结束时间：{{endTime}}</label>
			<label>广告链接：{{videoURL}}</label>
		</view>
		<view class="list-item-buttons">
			<button class="button is-danger" v-on:click="clickDelete">删除广告任务</button>
		</view>
	</li>
	
</template>


<style>
	
	.list-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.list-item-info {
		display: flex;
		flex-direction: column;
	}
	
	.list-item-comment {
		font-size: xx-large;
	}
</style>

